package com.acme.bankapp.domain.bank;

public class CheckingAccount extends AbstractAccount{
	private double overdraft;
	
	public CheckingAccount(double amount, double overdraft) {
		this.balance = amount;
		this.overdraft = overdraft;
		if (overdraft<0){
			System.out.println("Error creating account (negative overdraft)");
		} else {
			this.overdraft = overdraft;
		}

	}
	public void withdraw(double amount) {
		assert (this.balance >= amount + this.overdraft);
		this.balance -= amount;
	}
	
	public double maximumAmountToWithdraw(){
		return (this.balance + this.overdraft);
	}
	
}
